<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
	<TITLE>PhreeBooks - ZenCart Interface v1.0a</TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 3.4  (Win32)">
	<META NAME="CREATED" CONTENT="0;0">
	<META NAME="CHANGEDBY" CONTENT="David Premo">
	<META NAME="CHANGED" CONTENT="20120626;11454459">
	<META NAME="CHANGEDBY" CONTENT="David Premo">
	<STYLE TYPE="text/css">
	<!--
		P { font-family: "Verdana", "Geneva", sans-serif }
		TD P { font-family: "Verdana", "Geneva", sans-serif }
		H2.cjk { font-family: "SimSun" }
		H2.ctl { font-family: "Mangal" }
		H3.cjk { font-family: "SimSun" }
		H3.ctl { font-family: "Mangal" }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H1>Phreedom/ZenCart Interface Module - Release: 3.4</H1>
<P>Created 2010-01-06 (tested with PhreeBooks R1.9 and ZenCart
Release 1.3.8a) <BR>Updated 2011-01-25 (tested with Phreedom R3.0 and
ZenCart R1.3.9)<BR>Updated 2011-05-27 (tested with Phreedom R3.1 and
ZenCart R1.3.9)<BR>Updated 2012-06-25 (tested with Phreedom R3.4 and
ZenCart R1.5.0)<BR>Developed by PhreeSoft, LLC.</P>
<P>NOTE: The PHP cURL functions are required at both sides for the
XML transactions to work properly.</P>
<P>NOTE: The Bulk download function has been disabled as it seems to
trip over itself and  results in duplicate and missing orders. A
future release will convert this function to an ajax operation to
resolve this issue.</P>
<P>For questions, comments, and suggestions, please post on the
PhreeSoft forum at www.phreesoft.com/forum.</P>
<H1>Upgrading from a previous version of the ZenCart interface</H1>
<H2 CLASS="western">In ZenCart</H2>
<OL>
	<LI><P STYLE="margin-bottom: 0in">From the ZenCartFiles folder, copy
	the admin folder contents into your admin folder to overwrite the
	old Phreedom files. This will not overwrite any core files.</P>
	<LI><P STYLE="margin-bottom: 0in">From the ZenCartFiles folder, copy
	the includes folder contents into your includes folder (NOT admin
	folder) to overwrite the old Phreedom files. This will not overwrite
	any core files.</P>
	<LI><P STYLE="margin-bottom: 0in">The file
	/admin/orders_mod_phreedom.php needs to be merged with the original
	admin/orders.php file. Replace the four sections (search for
	PhreeSoft) with the four sections from the new file. If you do not
	have any more modules installed that customized the orders.php file,
	the file orders_mod_phreedom.php can simply be renamed orders.php.</P>
	<LI><P STYLE="margin-bottom: 0in">In 1.5.0, under Admin &rarr; Tools
	&rarr; Install SQL Patches, run the script <BR>installPhreedom.sql,
	which is located in the /ZenCartFiles directory. This will register
	the module so it appears in the menu.<BR><BR>
	</P>
	<P><B>NOTE:</B> From version 3.3 to version 3.4, many of the files
	that were named phreebooks have been renamed to phreedom. These old
	files are no longer needed and can be removed. However, leaving them
	there will not cause a problem as the references to them have been
	removed.</P>
</OL>
<H2 CLASS="western">In Phreedom</H2>
<OL>
	<LI><P STYLE="margin-bottom: 0in">Copy the files from the
	PhreedomFiles/modules folder to /modules folder. This will not
	overwrite any core files. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">If no other inventory
	customization is made, rename the two files in the
	/modules/inventory/custom/pages/main to extra_menus.php and
	extra_actions.php. If these files are already present, the two files
	must be merged together. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Navigate to Company &rarr; Module
	Administration and Install the ZenCart module. 
	</P>
	<LI><P>Edit the ZenCart Properties and enter the information (this
	should be the same as your prior install). Note: If the module was
	present when Phreedom was upgraded, this step should have been
	already completed. 
	</P>
</OL>
<H1>New Installation - Phreedom Side</H1>
<OL>
	<LI><P STYLE="margin-bottom: 0in; line-height: 150%">In php.ini
	ensure this option is set to On NOT Off: <FONT FACE="Courier New, Courier, monospace"><SPAN STYLE="font-weight: normal">short_open_tag
	= On</SPAN></FONT> 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Unzip the ZenCart module files and
	copy the PhreedomFiles/modules directory into the phreedom
	installation modules directory. No files should be over-written. 
	</P>
	<LI><P STYLE="line-height: 150%">Navigate to
	<FONT FACE="Courier New, Courier, monospace"><SPAN STYLE="font-weight: normal">modules/inventory/custom/pages/main</SPAN></FONT>
	and see if there were files previously present named extra_menus.php
	and extra_actions.php.<BR><BR>If so, the contents of the
	files<BR><FONT FACE="Courier New, Courier, monospace"><SPAN STYLE="font-weight: normal">extra_menus_zencart.php<BR>extra_actions_zencart.php</SPAN></FONT><BR>will
	need to be merged with these existing files and then can be
	deleted.<BR><BR>If there are no extra_menus.php or extra_actions.php
	already present, simply rename them<BR><FONT FACE="Courier New, Courier, monospace"><SPAN STYLE="font-weight: normal">extra_menus_zencart.php
	=&gt; extra_menus.php<BR>extra_actions_zencart.php =&gt;
	extra_actions.php</SPAN></FONT> 
	</P>
</OL>
<H1>Setup - Phreedom Side</H1>
<H2 CLASS="western">For Order Downloads</H2>
<OL>
	<LI><P STYLE="margin-bottom: 0in">Navigate to Company &rarr; Module
	Administration and Install the ZenCart module. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Edit the ZenCart Properties and
	enter the information.<BR><STRONG>ZenCart path:</STRONG> full url to
	path where the admin folder is located (the additional pathing
	soap/.. will be appended to this) <BR><STRONG>ZenCart user
	name/password:</STRONG> A admin user name and password to allow
	verification of the interface <BR><STRONG>ZenCart tax class:</STRONG>
	Must match the textual description of your store. This will be
	matched to the Phreedom description to determine the taxes to add to
	the order. <BR><STRONG>Price Sheets:</STRONG> Price sheet must exist
	in Phreedom for this feature to work. <BR><STRONG>Status codes:</STRONG>
	Must match the numeric code of the status to set set ZenCart orders
	after downloading/confirming with Phreedom. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Log in to Phreedom (you must have
	full rights to alter security settings of users) and select Company
	&rarr; Users.<BR>For each relevant user, go to the Tools tab and
	change the permissions for the ZenCart Interface to the desired
	access level. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Create a new user (and password)
	and set all permissions to None except the ZenCart Interface (set to
	Full).<BR>This user name will be used by ZenCart to insert data into
	Phreedom. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Log out and back in to reload the
	security settings. 
	</P>
	<LI><P>The install script will create a new tab in your inventory
	maintenance page along with three new fields. These new fields are
	required to properly sync your current products with the products in
	the ZenCart store. Check Inventory &rarr; Inventory Manager, Open a
	product and check the new ZenCart tab is correctly showing the three
	extra fields. The fields are summarized below: 
	</P>
</OL>
<TABLE WIDTH=100% BORDER=1 CELLPADDING=4 CELLSPACING=0>
	<TR VALIGN=TOP>
		<TD WIDTH=18%>
			<P>Description</P>
		</TD>
		<TD WIDTH=6%>
			<P>Category Member</P>
		</TD>
		<TD WIDTH=7%>
			<P>Field Type</P>
		</TD>
		<TD WIDTH=21%>
			<P>Default Value</P>
		</TD>
		<TD WIDTH=36%>
			<P>&nbsp;</P>
		</TD>
	</TR>
	<TR>
		<TD WIDTH=18%>
			<P>ZenCart - product to be uploaded</P>
		</TD>
		<TD WIDTH=6%>
			<P>ZenCart</P>
		</TD>
		<TD WIDTH=7%>
			<P>Checkbox</P>
		</TD>
		<TD WIDTH=21%>
			<P>as per your requirements</P>
		</TD>
		<TD WIDTH=36%>
			<P>Used to identify products that are allowed to be uploaded to
			Zen Cart. When the checkbox is selected, a clickable icon to
			upload will appear in the product listing options. 
			</P>
		</TD>
	</TR>
	<TR>
		<TD WIDTH=18%>
			<P>ZenCart - category id</P>
		</TD>
		<TD WIDTH=6%>
			<P>ZenCart</P>
		</TD>
		<TD WIDTH=7%>
			<P>TextField</P>
		</TD>
		<TD WIDTH=21%>
			<P>MUST match a category name</P>
		</TD>
		<TD WIDTH=36%>
			<P>Needs to match exactly with the name of the Zen Cart master
			category where you want the new product to go/the existing product
			is located.</P>
		</TD>
	</TR>
	<TR>
		<TD WIDTH=18%>
			<P>ZenCart - product manufacturer</P>
		</TD>
		<TD WIDTH=6%>
			<P>ZenCart</P>
		</TD>
		<TD WIDTH=7%>
			<P>TextField</P>
		</TD>
		<TD WIDTH=21%>
			<P>MUST match a manufacturer name</P>
		</TD>
		<TD WIDTH=36%>
			<P>Needs to match exactly with a manufacturer name as defined in
			ZenCart.</P>
		</TD>
	</TR>
</TABLE>
<H1>New Installation - ZenCart Side</H1>
<P>In the ZenCartFiles directory are two directories, admin and
includes. All files are Phreedom specific and will not overwrite core
ZenCart files during this step.</P>
<OL>
	<LI><P>Admin Files:<BR>Copy the contents of the admin directory to
	your Zen Cart admin directory (which should have been renamed from
	the default installation name of &ldquo;admin&rdquo; as per <A HREF="http://www.zen-cart.com/wiki/index.php/Important_Site_Security_Recommendations" TARGET="_blank">Zen
	Cart security recommendations</A>).<BR><BR>One core admin ZenCart
	file requires a modification.<BR>Navigate to the administration
	directory (default is /admin) and open orders.php.<BR>This may have
	been previously modified (for example if using Super Orders or the
	Edit Orders mod) and so the Phreedom code detailed below must be
	merged into the file.<BR>If this is an original orders.php then
	simply rename and archive the file orders.php and rename
	orders_mod_phreedom.php to orders.php.<BR><BR>If the orders.php file
	has been modified, there are four code additions required as shown
	below in the following code snippets: 
	</P>
</OL>
<H3 CLASS="western">SNIPPET 1 (around line 56):</H3>
<P><STRONG>Replace:</STRONG></P>
<P>if (zen_not_null($action) &amp;&amp; $order_exists == true)
{<BR>switch ($action) {</P>
<P><STRONG>With:</STRONG></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//
BOF - Individual and bulk download operation added by PhreeSoft to
download orders to PHREEDOM</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">define(</FONT><FONT COLOR="#0000c0">'PB_TEXT_DOWNLOAD'</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#0000c0">'Download
to Phreedom'</FONT><FONT COLOR="#000000">);</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">define(</FONT><FONT COLOR="#0000c0">'PB_TEXT_BULK_DOWNLOAD'</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#0000c0">'Bulk
Download to Phreedom'</FONT><FONT COLOR="#000000">);</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">define(</FONT><FONT COLOR="#0000c0">'PB_BULK_MESSAGE'</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#0000c0">'Completed
downloading orders to Phreedom. The number of orders successfully
downloaded was: %s'</FONT><FONT COLOR="#000000">);</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//
 if (zen_not_null($action) &amp;&amp; $order_exists == true) { //
original line commented out</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//
   switch ($action) { // original line commented out</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><BR>
</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>/****
This has been disabled since it results in duplicate SO's in Phreedom
**********************</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"> 
<FONT FACE="Consolas, sans-serif"><FONT SIZE=2>switch ($action) {</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f">   
<FONT FACE="Consolas, sans-serif"><FONT SIZE=2>case 'bulk_dl':</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 $pb_orders = array();</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 $pb_list   = $db-&gt;Execute(&quot;select orders_id from &quot; .
TABLE_ORDERS . &quot; where phreebooks = 0&quot;);</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 while (!$pb_list-&gt;EOF) {</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>		$pb_orders[]
= $pb_list-&gt;fields['orders_id'];</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>		$pb_list-&gt;MoveNext();</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 }</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 require_once(DIR_WS_CLASSES . 'phreedom.php');</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 $dnXML = new phreedom();</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 if (sizeof($pb_orders) &gt; 0) $dnXML-&gt;submitXML('download',
$pb_orders);</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 $_GET['action'] = '';</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 $action         = '';</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 $oID            = '';</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>	
 break;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f">  <FONT FACE="Consolas, sans-serif"><FONT SIZE=2>}</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>*/</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">  </FONT><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>if
</B></FONT><FONT COLOR="#000000">(zen_not_null($action) &amp;&amp;
$order_exists == </FONT><FONT COLOR="#7f0055"><B>true</B></FONT><FONT COLOR="#000000">)
{</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">	</FONT><FONT COLOR="#7f0055"><B>switch
</B></FONT><FONT COLOR="#000000">($action) {</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">     
</FONT><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>case
</B></FONT><FONT COLOR="#0000c0">'download'</FONT><FONT COLOR="#000000">:</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">      
 </FONT><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>require_once</B></FONT><FONT COLOR="#000000">(DIR_WS_CLASSES
. </FONT><FONT COLOR="#0000c0">'phreedom.php'</FONT><FONT COLOR="#000000">);
</FONT><FONT COLOR="#557f5f">// open the phreedom class</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">      
 <FONT FACE="Consolas, sans-serif"><FONT SIZE=2>$dnXML = </FONT><FONT COLOR="#7f0055"><B>new
</B></FONT><FONT COLOR="#000000">phreedom();</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">		$dnXML-&gt;submitXML(</FONT><FONT COLOR="#0000c0">'download'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#7f0055"><B>array</B></FONT><FONT COLOR="#000000">($oID));</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">      
 <FONT FACE="Consolas, sans-serif"><FONT SIZE=2>$_GET[</FONT><FONT COLOR="#0000c0">'action'</FONT><FONT COLOR="#000000">]
= </FONT><FONT COLOR="#0000c0">''</FONT><FONT COLOR="#000000">;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">		$action
        = </FONT><FONT COLOR="#0000c0">''</FONT><FONT COLOR="#000000">;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">		$oID
           = </FONT><FONT COLOR="#0000c0">''</FONT><FONT COLOR="#000000">;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">		</FONT><FONT COLOR="#7f0055"><B>break</B></FONT><FONT COLOR="#000000">;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Times New Roman, serif"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//
EOF - Download operation added by PhreeSoft</FONT></FONT></FONT></FONT></P>
<H3 CLASS="western">SNIPPET #2 (around line 744):</H3>
<P><STRONG>After:</STRONG></P>
<P>&lt;td class=&quot;pageHeading&quot;&gt;&lt;?php echo
HEADING_TITLE; ?&gt;&lt;/td&gt;</P>
<P><STRONG>Add:</STRONG></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#ff0000">&lt;?php</FONT><FONT COLOR="#000000">
</FONT><FONT COLOR="#557f5f">// BOF - Modified by PhreeSoft for
Phreedom</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//**************
This has been disabled pending bug duplicating SO's in Phreedom with
same SO Number **************88</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//echo
'&lt;td class=&quot;pageHeading&quot;&gt;&lt;a href=&quot;' .
zen_href_link(FILENAME_ORDERS,
zen_get_all_get_params(array('action')) . '&amp;action=bulk_dl',
'NONSSL') . '&quot;&gt;';</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//echo
'    &lt;input type=&quot;button&quot; name=&quot;pb_bulk_dl&quot;
id=&quot;pb_bulk_dl&quot; value=&quot;' . PB_TEXT_BULK_DOWNLOAD . '&quot;
style=&quot;cursor:pointer;&quot;&gt;';</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//echo
'&lt;/a&gt;&lt;/td&gt;';</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Times New Roman, serif"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//
EOF - Modified by PhreeSoft for Phreedom </FONT></FONT></FONT><FONT COLOR="#ff0000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>?&gt;</FONT></FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><BR>
</P>
<P><STRONG>Before:</STRONG></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Times New Roman, serif"><FONT COLOR="#008080"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>&lt;</FONT></FONT></FONT><FONT COLOR="#3f7f7f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>td</FONT></FONT></FONT><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>
</FONT></FONT><FONT COLOR="#7f007f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>class</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>=</FONT></FONT></FONT><FONT COLOR="#2a00ff"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><I>&quot;pageHeading&quot;</I></FONT></FONT></FONT><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>
</FONT></FONT><FONT COLOR="#7f007f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>align</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>=</FONT></FONT></FONT><FONT COLOR="#2a00ff"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><I>&quot;right&quot;</I></FONT></FONT></FONT><FONT COLOR="#008080"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>&gt;</FONT></FONT></FONT><FONT COLOR="#ff0000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>&lt;?php</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>
</FONT></FONT></FONT><FONT COLOR="#7f0055"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><B>echo
</B></FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>zen_draw_separator(</FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>'pixel_trans.gif'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>,
1, HEADING_IMAGE_HEIGHT); </FONT></FONT></FONT><FONT COLOR="#ff0000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>?&gt;</FONT></FONT></FONT><FONT COLOR="#008080"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>&lt;/</FONT></FONT></FONT><FONT COLOR="#3f7f7f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>td</FONT></FONT></FONT><FONT COLOR="#008080"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>&gt;</FONT></FONT></FONT></FONT></P>
<H3 CLASS="western">SNIPPET #3 (around line 843):</H3>
<P><STRONG>After:</STRONG></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Times New Roman, serif"><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>$new_fields
= </FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>&quot;,
o.customers_company, o.customers_email_address,
o.customers_street_address, o.delivery_company, o.delivery_name,
o.delivery_street_address, o.billing_company, o.billing_name,
o.billing_street_address, o.payment_module_code,
o.shipping_module_code, o.ip_address &quot;</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>;</FONT></FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><BR>
</P>
<P><STRONG>Add:</STRONG></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//
BOF - Added by PhreeSoft </FONT></FONT></FONT>
</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>if
</B></FONT><FONT COLOR="#000000">(MODULE_PHREEDOM_ORDER_DOWNLOAD_STATUS
== </FONT><FONT COLOR="#0000c0">'True'</FONT><FONT COLOR="#000000">)
$new_fields .= </FONT><FONT COLOR="#0000c0">&quot;, o.phreebooks &quot;</FONT><FONT COLOR="#000000">;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Times New Roman, serif"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//
EOF -  Added by PhreeSoft</FONT></FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><BR>
</P>
<P><STRONG>Before:</STRONG></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#ff0000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>?&gt;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#ff0000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>&lt;?php</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">    </FONT><FONT FACE="Times New Roman, serif"><FONT COLOR="#7f0055"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><B>if
</B></FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>(</FONT></FONT></FONT><FONT COLOR="#7f0055"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><B>isset</B></FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>($_GET[</FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>'cID'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>]))
{</FONT></FONT></FONT></FONT></P>
<H3 CLASS="western">SNIPPET #4 (around line 937):</H3>
<P><STRONG>After: </STRONG>
</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#008080"><U>&lt;</U></FONT><FONT COLOR="#3f7f7f"><U>td</U></FONT><FONT COLOR="#000000"><U>
</U></FONT><FONT COLOR="#7f007f"><U>class</U></FONT><FONT COLOR="#000000"><U>=</U></FONT><FONT COLOR="#2a00ff"><I><U>&quot;dataTableContent&quot;</U></I></FONT><FONT COLOR="#000000"><U>
</U></FONT><FONT COLOR="#7f007f"><U>align</U></FONT><FONT COLOR="#000000"><U>=</U></FONT><FONT COLOR="#2a00ff"><I><U>&quot;center&quot;</U></I></FONT><FONT COLOR="#008080"><U>&gt;</U></FONT><FONT COLOR="#ff0000">&lt;?php</FONT><FONT COLOR="#000000">
</FONT><FONT COLOR="#7f0055"><B>echo
</B></FONT><FONT COLOR="#000000">(zen_get_orders_comments($orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">])
== </FONT><FONT COLOR="#0000c0">'' </FONT><FONT COLOR="#000000">? </FONT><FONT COLOR="#0000c0">''
</FONT><FONT COLOR="#000000">: zen_image(DIR_WS_IMAGES .
</FONT><FONT COLOR="#0000c0">'icon_yellow_on.gif'</FONT><FONT COLOR="#000000">,
TEXT_COMMENTS_YES, 16, 16)); </FONT><FONT COLOR="#ff0000">?&gt;</FONT><FONT COLOR="#008080">&lt;/</FONT><FONT COLOR="#3f7f7f">td</FONT><FONT COLOR="#008080">&gt;</FONT></FONT></FONT></P>
<P><BR><BR>
</P>
<P><STRONG>Replace:</STRONG></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#008080">&lt;</FONT><FONT COLOR="#3f7f7f">td</FONT><FONT COLOR="#3f5fbf">
</FONT><FONT COLOR="#7f007f">class</FONT><FONT COLOR="#000000">=</FONT><FONT COLOR="#2a00ff"><I>&quot;dataTableContent&quot;</I></FONT><FONT COLOR="#3f5fbf">
</FONT><FONT COLOR="#7f007f">align</FONT><FONT COLOR="#000000">=</FONT><FONT COLOR="#2a00ff"><I>&quot;right&quot;</I></FONT><FONT COLOR="#008080">&gt;</FONT><FONT COLOR="#ff0000">&lt;?php</FONT><FONT COLOR="#000000">
</FONT><FONT COLOR="#7f0055"><B>echo </B></FONT><FONT COLOR="#0000c0">'&lt;a
href=&quot;' </FONT><FONT COLOR="#000000">.
zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(</FONT><FONT COLOR="#7f0055"><B>array</B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000c0">'oID'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">'action'</FONT><FONT COLOR="#000000">))
. </FONT><FONT COLOR="#0000c0">'oID=' </FONT><FONT COLOR="#000000">.
$orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">]
. </FONT><FONT COLOR="#0000c0">'&amp;action=edit'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">'NONSSL'</FONT><FONT COLOR="#000000">) .
</FONT><FONT COLOR="#0000c0">'&quot;&gt;' </FONT><FONT COLOR="#000000">.
zen_image(DIR_WS_IMAGES . </FONT><FONT COLOR="#0000c0">'icon_edit.gif'</FONT><FONT COLOR="#000000">,
ICON_EDIT) . </FONT><FONT COLOR="#0000c0">'&lt;/a&gt;'</FONT><FONT COLOR="#000000">;
</FONT><FONT COLOR="#ff0000">?&gt;&lt;?php</FONT><FONT COLOR="#000000">
</FONT><FONT COLOR="#7f0055"><B>if </B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#7f0055"><B>isset</B></FONT><FONT COLOR="#000000">($oInfo)
&amp;&amp; is_object($oInfo) &amp;&amp; ($orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">]
== $oInfo-&gt;</FONT><FONT COLOR="#0000c0">orders_id</FONT><FONT COLOR="#000000">))
{ </FONT><FONT COLOR="#7f0055"><B>echo </B></FONT><FONT COLOR="#000000">zen_image(DIR_WS_IMAGES
. </FONT><FONT COLOR="#0000c0">'icon_arrow_right.gif'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">''</FONT><FONT COLOR="#000000">); } </FONT><FONT COLOR="#7f0055"><B>else
</B></FONT><FONT COLOR="#000000">{ </FONT><FONT COLOR="#7f0055"><B>echo
</B></FONT><FONT COLOR="#0000c0">'&lt;a href=&quot;' </FONT><FONT COLOR="#000000">.
zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(</FONT><FONT COLOR="#7f0055"><B>array</B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000c0">'oID'</FONT><FONT COLOR="#000000">))
. </FONT><FONT COLOR="#0000c0">'oID=' </FONT><FONT COLOR="#000000">.
$orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">],
</FONT><FONT COLOR="#0000c0">'NONSSL'</FONT><FONT COLOR="#000000">) .
</FONT><FONT COLOR="#0000c0">'&quot;&gt;' </FONT><FONT COLOR="#000000">.
zen_image(DIR_WS_IMAGES . </FONT><FONT COLOR="#0000c0">'icon_info.gif'</FONT><FONT COLOR="#000000">,
IMAGE_ICON_INFO) . </FONT><FONT COLOR="#0000c0">'&lt;/a&gt;'</FONT><FONT COLOR="#000000">;
} </FONT><FONT COLOR="#ff0000">?&gt;</FONT><FONT COLOR="#2a00ff">&amp;nbsp;</FONT><FONT COLOR="#008080">&lt;/</FONT><FONT COLOR="#3f7f7f">td</FONT><FONT COLOR="#008080">&gt;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><BR>
</P>
<P><STRONG>With:</STRONG></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#ff0000">&lt;?php</FONT><FONT COLOR="#000000">
</FONT><FONT COLOR="#557f5f">// BOF - Download icon added by
PhreeSoft to download order </FONT><FONT COLOR="#ff0000">?&gt;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">      
         </FONT><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#008080"><U>&lt;</U></FONT><FONT COLOR="#3f7f7f"><U>td</U></FONT><FONT COLOR="#000000"><U>
</U></FONT><FONT COLOR="#7f007f"><U>class</U></FONT><FONT COLOR="#000000"><U>=</U></FONT><FONT COLOR="#2a00ff"><I><U>&quot;dataTableContent&quot;</U></I></FONT><FONT COLOR="#000000"><U>
</U></FONT><FONT COLOR="#7f007f"><U>align</U></FONT><FONT COLOR="#000000"><U>=</U></FONT><FONT COLOR="#2a00ff"><I><U>&quot;right&quot;</U></I></FONT><FONT COLOR="#008080"><U>&gt;</U></FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#ff0000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>&lt;?php</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>if
</B></FONT><FONT COLOR="#000000">($orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'phreebooks'</FONT><FONT COLOR="#000000">]
== 0 &amp;&amp; MODULE_PHREEDOM_ORDER_DOWNLOAD_STATUS == </FONT><FONT COLOR="#0000c0">'True'</FONT><FONT COLOR="#000000">)
{</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">  </FONT><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>echo
</B></FONT><FONT COLOR="#0000c0">'&lt;a href=&quot;' </FONT><FONT COLOR="#000000">.
zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(</FONT><FONT COLOR="#7f0055"><B>array</B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000c0">'oID'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">'action'</FONT><FONT COLOR="#000000">))
. </FONT><FONT COLOR="#0000c0">'oID=' </FONT><FONT COLOR="#000000">.
$orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">]
. </FONT><FONT COLOR="#0000c0">'&amp;action=download'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">'NONSSL'</FONT><FONT COLOR="#000000">) .
</FONT><FONT COLOR="#0000c0">'&quot;&gt;' </FONT><FONT COLOR="#000000">.
zen_image(DIR_WS_IMAGES . </FONT><FONT COLOR="#0000c0">'icons/file_download.gif'</FONT><FONT COLOR="#000000">,
PB_TEXT_DOWNLOAD) . </FONT><FONT COLOR="#0000c0">'&lt;/a&gt;'</FONT><FONT COLOR="#000000">;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>}</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#557f5f"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>//
this is the original line expanded to make it more readable</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>echo
</B></FONT><FONT COLOR="#0000c0">'&lt;a href=&quot;' </FONT><FONT COLOR="#000000">.
zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(</FONT><FONT COLOR="#7f0055"><B>array</B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000c0">'oID'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">'action'</FONT><FONT COLOR="#000000">))
. </FONT><FONT COLOR="#0000c0">'oID=' </FONT><FONT COLOR="#000000">.
$orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">]
. </FONT><FONT COLOR="#0000c0">'&amp;action=edit'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">'NONSSL'</FONT><FONT COLOR="#000000">) .
</FONT><FONT COLOR="#0000c0">'&quot;&gt;' </FONT><FONT COLOR="#000000">.
zen_image(DIR_WS_IMAGES . </FONT><FONT COLOR="#0000c0">'icon_edit.gif'</FONT><FONT COLOR="#000000">,
ICON_EDIT) . </FONT><FONT COLOR="#0000c0">'&lt;/a&gt;'</FONT><FONT COLOR="#000000">;
</FONT></FONT></FONT>
</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>if
</B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#7f0055"><B>isset</B></FONT><FONT COLOR="#000000">($oInfo)
&amp;&amp; is_object($oInfo) &amp;&amp; ($orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">]
== $oInfo-&gt;</FONT><FONT COLOR="#0000c0">orders_id</FONT><FONT COLOR="#000000">))
{ </FONT></FONT></FONT>
</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">  </FONT><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>echo
</B></FONT><FONT COLOR="#000000">zen_image(DIR_WS_IMAGES .
</FONT><FONT COLOR="#0000c0">'icon_arrow_right.gif'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">''</FONT><FONT COLOR="#000000">); </FONT></FONT></FONT>
</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">}
</FONT><FONT COLOR="#7f0055"><B>else </B></FONT><FONT COLOR="#000000">{
</FONT></FONT></FONT>
</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000">  </FONT><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#7f0055"><B>echo
</B></FONT><FONT COLOR="#0000c0">'&lt;a href=&quot;' </FONT><FONT COLOR="#000000">.
zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(</FONT><FONT COLOR="#7f0055"><B>array</B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000c0">'oID'</FONT><FONT COLOR="#000000">))
. </FONT><FONT COLOR="#0000c0">'oID=' </FONT><FONT COLOR="#000000">.
$orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">],
</FONT><FONT COLOR="#0000c0">'NONSSL'</FONT><FONT COLOR="#000000">) .
</FONT><FONT COLOR="#0000c0">'&quot;&gt;' </FONT><FONT COLOR="#000000">.
zen_image(DIR_WS_IMAGES . </FONT><FONT COLOR="#0000c0">'icon_info.gif'</FONT><FONT COLOR="#000000">,
IMAGE_ICON_INFO) . </FONT><FONT COLOR="#0000c0">'&lt;/a&gt;'</FONT><FONT COLOR="#000000">;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>}
</FONT></FONT></FONT>
</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT COLOR="#ff0000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>?&gt;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#000000">				</FONT><FONT COLOR="#008080">&lt;/</FONT><FONT COLOR="#3f7f7f">td</FONT><FONT COLOR="#008080">&gt;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#ff0000">&lt;?php</FONT><FONT COLOR="#000000">
</FONT><FONT COLOR="#557f5f">// comment out original line since it
have the table tags in it </FONT><FONT COLOR="#ff0000">?&gt;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#3f5fbf">&lt;!--
           &lt;td class=&quot;dataTableContent&quot;
align=&quot;right&quot;&gt;</FONT><FONT COLOR="#ff0000">&lt;?php</FONT><FONT COLOR="#000000">
</FONT><FONT COLOR="#7f0055"><B>echo </B></FONT><FONT COLOR="#0000c0">'&lt;a
href=&quot;' </FONT><FONT COLOR="#000000">.
zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(</FONT><FONT COLOR="#7f0055"><B>array</B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000c0">'oID'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">'action'</FONT><FONT COLOR="#000000">))
. </FONT><FONT COLOR="#0000c0">'oID=' </FONT><FONT COLOR="#000000">.
$orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">]
. </FONT><FONT COLOR="#0000c0">'&amp;action=edit'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">'NONSSL'</FONT><FONT COLOR="#000000">) .
</FONT><FONT COLOR="#0000c0">'&quot;&gt;' </FONT><FONT COLOR="#000000">.
zen_image(DIR_WS_IMAGES . </FONT><FONT COLOR="#0000c0">'icon_edit.gif'</FONT><FONT COLOR="#000000">,
ICON_EDIT) . </FONT><FONT COLOR="#0000c0">'&lt;/a&gt;'</FONT><FONT COLOR="#000000">;
</FONT><FONT COLOR="#ff0000">?&gt;&lt;?php</FONT><FONT COLOR="#000000">
</FONT><FONT COLOR="#7f0055"><B>if </B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#7f0055"><B>isset</B></FONT><FONT COLOR="#000000">($oInfo)
&amp;&amp; is_object($oInfo) &amp;&amp; ($orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">]
== $oInfo-&gt;</FONT><FONT COLOR="#0000c0">orders_id</FONT><FONT COLOR="#000000">))
{ </FONT><FONT COLOR="#7f0055"><B>echo </B></FONT><FONT COLOR="#000000">zen_image(DIR_WS_IMAGES
. </FONT><FONT COLOR="#0000c0">'icon_arrow_right.gif'</FONT><FONT COLOR="#000000">,
</FONT><FONT COLOR="#0000c0">''</FONT><FONT COLOR="#000000">); } </FONT><FONT COLOR="#7f0055"><B>else
</B></FONT><FONT COLOR="#000000">{ </FONT><FONT COLOR="#7f0055"><B>echo
</B></FONT><FONT COLOR="#0000c0">'&lt;a href=&quot;' </FONT><FONT COLOR="#000000">.
zen_href_link(FILENAME_ORDERS, zen_get_all_get_params(</FONT><FONT COLOR="#7f0055"><B>array</B></FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000c0">'oID'</FONT><FONT COLOR="#000000">))
. </FONT><FONT COLOR="#0000c0">'oID=' </FONT><FONT COLOR="#000000">.
$orders-&gt;</FONT><FONT COLOR="#0000c0">fields</FONT><FONT COLOR="#000000">[</FONT><FONT COLOR="#0000c0">'orders_id'</FONT><FONT COLOR="#000000">],
</FONT><FONT COLOR="#0000c0">'NONSSL'</FONT><FONT COLOR="#000000">) .
</FONT><FONT COLOR="#0000c0">'&quot;&gt;' </FONT><FONT COLOR="#000000">.
zen_image(DIR_WS_IMAGES . </FONT><FONT COLOR="#0000c0">'icon_info.gif'</FONT><FONT COLOR="#000000">,
IMAGE_ICON_INFO) . </FONT><FONT COLOR="#0000c0">'&lt;/a&gt;'</FONT><FONT COLOR="#000000">;
} </FONT><FONT COLOR="#ff0000">?&gt;</FONT><FONT COLOR="#3f5fbf">&amp;nbsp;&lt;/td&gt;
--&gt;</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><FONT COLOR="#ff0000">&lt;?php</FONT><FONT COLOR="#000000">
</FONT><FONT COLOR="#557f5f">// EOF - added by PhreeSoft </FONT><FONT COLOR="#ff0000">?&gt;</FONT></FONT></FONT></P>
<P><BR><BR>
</P>
<OL START=2>
	<LI><P STYLE="margin-bottom: 0in">Catalog Files:<BR>Copy the
	contents of the includes directory to the /includes directory. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Extra Fields will be created in
	the database, field phreebooks in table orders and field
	phreebooks_sku in table products when the order download module is
	installed. These are required to track download status and to match
	products between ZenCart and Phreedom (since ZenCart doesn't use
	SKUs).</P>
	<LI><P STYLE="margin-bottom: 0in">In 1.5.0, under Admin &rarr; Tools
	&rarr; Install SQL Patches, run the script <BR>installPhreedom.sql,
	which is located in the /ZenCartFiles directory. This will register
	the module so it appears in the menu.</P>
</OL>
<H1>SETUP &ndash; ZenCart Side</H1>
<OL>
	<LI><P STYLE="margin-bottom: 0in">Go to Admin &rarr; Modules &rarr;
	Phreedom Interface<BR>If anything looks amiss or there is text
	missing above the install button, not all files have been uploaded
	correctly.<BR>Install/enable the order download capability. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">For the Phreedom XML URL enter:
	http://path_to_phreedom_root/soap/orders.php (or https:// if used) 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Enter the Phreedom database name.
	(used to select the proper company) 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Enter the ISO language (typically
	en_us) for error messages. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Enter the Phreedom user name
	created for downloading orders. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Enter the Phreedom password for
	the user. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Enter an optional prefix (e.g. ZC)
	to use for creating the sales order number. Note Phreedom does not
	allow for duplicate Sales Order numbers. Adding a prefix will
	prevent conflict between downloaded orders and orders generated
	within Phreedom. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">If using multi_store, enter a
	store id here. This can be used for reporting activity through
	different sales channels. This field is not required and may be left
	blank. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Enter a sales rep id. This field
	is not required and may be left blank. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Enter the gl sales account number
	to post the order. This number must match to the chart of accounts
	in Phreedom or an error will result. Typically a sales type account
	is used. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Enter the gl receivables account
	number. This number must match to the chart of accounts in Phreedom
	or an error will result. Typically a receivables type account is
	used. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">If you want the order status to be
	updated when an order is downloaded, select the status you want to
	set the order to. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">When importing an order Phreedom
	will auto-generate a customer id to create the customer account.
	Either the email address can be used or the billing telephone number
	(all non-numeric characters are stripped). This will then be used as
	the Customer ID within Phreedom. 
	</P>
	<LI><P>Categories in Phreedom must exist in Zen Cart and match
	identically. This is used to properly determine where to place the
	item in the Zen Cart catalog. 
	</P>
</OL>
<H1>USAGE - Phreedom Side</H1>
<H2 CLASS="western">Product Upload</H2>
<OL>
	<LI><P STYLE="margin-bottom: 0in">Inventory &rarr; Maintain<BR>Once
	the added fields have been entered into Phreedom, the catalog check
	box is tested for each inventory item and if selected, an upload
	icon will appear next to the inventory item in the action area of
	the main inventory screen. Click the button to upload the product. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Tools &rarr; ZenCart Interface &rarr;
	Bulk Upload<BR>This action will upload all inventory items that have
	the catalog checkbox set in the inventory database. 
	</P>
	<LI><P STYLE="margin-bottom: 0in">Tools &rarr; ZenCart Interface &rarr;
	Synchronize Products<BR>This feature will compare the selected
	inventory items from the Phreedom inventory database file and verify
	they match with the products listed on your Zen Cart
	e-store.<BR>Phreedom will not delete the items on the Zen Cart store
	but will identify items that are there but are not flagged to be
	there. They must be removed manually from Zen Cart. 
	</P>
	<LI><P>Tools &rarr; ZenCart Interface &rarr; Confirm Shipments<BR>This
	feature will change the status for all orders shipped on the
	selected date. Data is pulled from the shipping_log table and will
	include the carrier and tracking number.<BR>The order status will be
	changed to the value set during the ZenCart Administration setup. 
	</P>
</OL>
<H2 CLASS="western">Order Download</H2>
<P>No action (data is received)</P>
<H1>USAGE - ZenCart Side</H1>
<H2 CLASS="western">Product Upload</H2>
<P>No action (data is received)</P>
<H2 CLASS="western">Order Download</H2>
<OL>
	<LI><P STYLE="margin-bottom: 0in">Individual Order Download - Once
	an order has been placed, select Customers &rarr; Orders from the
	admin screen.<BR>An icon will appear in the action area next to each
	order to download the order (tooltip 'Download').<BR>Click the
	button to download the order to Phreedom. If successful, the page
	will reload and the icon will no longer appear. Repeat for all other
	orders. 
	</P>
	<LI><P>Bulk Download - The button at the top of the Orders page will
	attempt to download all orders that have the Download status flag
	(table orders, field phreebooks) set to zero. A status message will
	be displayed with the results of the bulk download attempt. 
	</P>
</OL>
<H1>Download/Upload problems</H1>
<H2 CLASS="western">Inventory Upload Problems</H2>
<P STYLE="line-height: 150%">To show the raw xml that is being passed
to Zen Cart: in <FONT FACE="Courier New, Courier, monospace"><SPAN STYLE="font-weight: normal">Phreedom<BR>/modules/zencart/classes/zencart.php</SPAN></FONT></P>
<P>un-comment these lines (48 and 50):</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Times New Roman, serif"><FONT COLOR="#7f0055"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><B>echo
</B></FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>'Submit
to ' </FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>.
ZENCART_URL . </FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>'/soap/'
</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>.
$url . </FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>'
and XML string = &lt;pre&gt;' </FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>.
htmlspecialchars($this-&gt;</FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>strXML</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>)
. </FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>'&lt;/pre&gt;&lt;br
/&gt;'</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>;</FONT></FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><BR>
</P>
<P ALIGN=LEFT STYLE="margin-bottom: 0in"><FONT FACE="Times New Roman, serif"><FONT COLOR="#7f0055"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2><B>echo
</B></FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>'XML
response (at the Phreedom side from Zencart) =&gt; &lt;pre&gt;' </FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>.
htmlspecialchars($this-&gt;</FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>response</FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>)
. </FONT></FONT></FONT><FONT COLOR="#0000c0"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>'&lt;/pre&gt;&lt;br
/&gt;' </FONT></FONT></FONT><FONT COLOR="#000000"><FONT FACE="Consolas, sans-serif"><FONT SIZE=2>.
chr(10);</FONT></FONT></FONT></FONT></P>
<H3 CLASS="western">Error: Phreedom Zencart XML parse error:
Processing Instruction not started at line 1</H3>
<P>Check in php.ini that this option is On:</P>
<P STYLE="font-weight: normal; line-height: 150%"><FONT FACE="Courier New, Courier, monospace">short_open_tag
= On</FONT></P>
<H3 CLASS="western">Error # 14 - The category name could not be
found...</H3>
<P>Check the category id being passed:</P>
<P STYLE="line-height: 150%">In<BR><FONT FACE="Courier New, Courier, monospace"><SPAN STYLE="font-weight: normal">/modules/zencart/classes/zencart.php</SPAN></FONT></P>
<P>insert this line</P>
<P>echo 'category_id = ' . $result-&gt;fields['category_id'] .
'&lt;br&gt;';</P>
<P>above this one 
</P>
<P>$this-&gt;strXML .= xmlEntry('ProductCategory',
$result-&gt;fields['category_id']);</P>
<P>This will show the category_id that Phreedom is sending out.</P>
<H2 CLASS="western">Order download problems</H2>
<P>In Zen Cart: /admin/includes/classes/phreedom.php</P>
<P>you can un-comment three echo statements around line 36. These
will output the xml that is being passed.</P>
</BODY>
</HTML>